package exercise;

import java.util.Scanner;

/**
 * @author ZhanBo
 * @date 2020/7/25
 */
public class Main1 {

    public static void method(String str){
        int result = 0;
        int frontIndex = 0;
        int postIndex = frontIndex+5;
        for (int i = 0  ;i<str.length() ; i++){
            if (frontIndex<str.length() &&  postIndex<=str.length()){
                if (str.substring(frontIndex,postIndex).equals("hnist")){
                    result++;
                    frontIndex=frontIndex+5;
                    postIndex = frontIndex+5;
                }else {
                    frontIndex++;
                    postIndex = frontIndex+5;
                }
            }
        }
        System.out.println(result);
    }

    public static void main(String[] args) {
        System.out.println("hello world！");
//        String s ="hnist hnist ";
//        Scanner scanner = new Scanner(System.in);
//        while (scanner.hasNext()){
//            String str = scanner.next();
//            method(str);
//        }
    }


}


